package com.mti.monitor.bean.model;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_monitor_config")
@ApiModel(description = "监控服务配置")
public class SysMonitorConfig {

    @TableId
    @TableField("id")
    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "任务类型：server服务类，data数据类，statistics统计类")
    @TableField("task_type")
    private String taskType;

    @ApiModelProperty(value = "任务名称")
    @TableField("task_name")
    private String taskName;

    @ApiModelProperty(value = "任务描述")
    @TableField("task_desc")
    private String taskDesc;


    @ApiModelProperty(value = "cron表达式")
    @TableField("scheduled_cron")
    private String scheduledCron;


    @ApiModelProperty(value = "短信内容")
    @TableField("message_content")
    private String messageContent;


    @ApiModelProperty(value = "系统名称")
    @TableField("system_name")
    private String systemName;


    @ApiModelProperty(value = "系统URL")
    @TableField("system_url")
    private String systemUrl;


    @ApiModelProperty(value = "短信通道：kmga昆明公安，目前没有其他选项")
    @TableField("message_channel")
    private String messageChannel;


    @ApiModelProperty(value = "数据预警sql")
    @TableField("data_monitor_sql")
    private String dataMonitorSql;


    @ApiModelProperty(value = "统计sql")
    @TableField("statics_sql")
    private String staticsSql;


    @ApiModelProperty(value = "预警间隔时间，目前仅支持天、小时、分钟", example = "1 day / 1 hour / 1 min ")
    @TableField("interval_time")
    private String intervalTime;


    @ApiModelProperty(value = "允许试错次数，当等于试错次数+1时，发送服务心跳检测预警短信")
    @TableField("allow_error_count")
    private Integer allowErrorCount;


    @ApiModelProperty(value = "收信人电话，逗号分隔")
    @TableField("phone_numbers")
    private String phoneNumbers;

    @ApiModelProperty(value = "是否有效")
    @TableField("use_yn")
    private Boolean useYn;

    @ApiModelProperty(value = "是否删除")
    @TableField("delete_yn")
    private Boolean deleteYn;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "数据源Id")
    @TableField("data_source_id")
    private String dataSourceId;

    @ApiModelProperty(value = "最后一条记录时间sql")
    @TableField("last_time_sql")
    private String lastTimeSql;


    @ApiModelProperty(value = "远程SSH IP")
    @TableField("ssh_ip")
    private String sshIp;

    @ApiModelProperty(value = "远程SSH 端口")
    @TableField("ssh_port")
    private Integer sshPort;

    @ApiModelProperty(value = "远程SSH 用户名")
    @TableField("ssh_user")
    private String sshUser;

    @ApiModelProperty(value = "远程SSH 密码 AES加密")
    @TableField("ssh_pwd")
    private String sshPwd;

    @ApiModelProperty(value = "远程SSH 重启脚本命令路径 如：/app/service/xxx/run.sh")
    @TableField("restart_file_path")
    private String restartFilePath;
}
